# test/integration/CMakeLists.txt

# source files
set(INTEGRATION_TEST_SOURCES
    basic_flow_test.cpp
)

# create an executable for each integration test
foreach(test_source ${INTEGRATION_TEST_SOURCES})
    # basic setting
    get_filename_component(test_name ${test_source} NAME_WE)
    add_executable(${test_name} ${test_source})
    target_compile_features(${test_name} PRIVATE cxx_std_20)

    target_compile_options(${test_name} PRIVATE
        -Wall
        -Wextra
        -Wpedantic
        -g
    )

    target_link_libraries(${test_name} PRIVATE
        ${PROJECT_NAME}_static
        ${PCAP_LIBRARY}
        Threads::Threads
    )

    target_include_directories(${test_name} PRIVATE
        ${CMAKE_SOURCE_DIR}/include
        ${PCAP_INCLUDE_DIRS}
    )

    # add CTest
    add_test(
        NAME integration_${test_name}
        COMMAND ${test_name}
    )

    # set_tests_properties(integration_${test_name} PROPERTIES
    #     TIMEOUT ${TEST_TIMEOUT}
    #     LABELS "integration"
    # )

endforeach()